package com.leetcode.concurrency.demo;

/**
 * @author Dennis Li
 * @date 2020/8/11 15:15
 */
public class InterruptedDemo {

    public static void main(String[] args) {
        final Thread thread = new Thread(new Demo());
        thread.start();
        thread.interrupt();
        System.out.println("End");
    }

    static class Demo extends Thread {

        @Override
        public void run() {
            while (interrupted());
            System.out.println("Out of interrupted");
        }
    }

}
